T.PathEx = T.jT.extend({
	options: {
		color: "red",
		weight: 5,
		opacity: .5
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		this.iY(t)
	},
	getPath: function() {
		return this.ht
	},
	setLngLats: function(t) {
		return this.iY(t),
		this.redraw()
	},
	iY: function(t) {
		this.ht = t
	},
	getLngLats: function() {
		return this.ht
	},
	Oe: function() {
		this.jE && this.rt()
	},
	rt: function() {
		this.bT.TD(this)
	},
	Rt: function() {
		this._points = [];
		for (var t = 0; t < this.ht.length; t++) {
			var i = !1;
			if (this.ht[t - 1]) {
				var e = this.jE.lngLatToLayerPoint(this.ht[t - 1]),
				s = this.jE.lngLatToLayerPoint(this.ht[t]);
				0 == e.distanceTo(s) && (i = !0)
			}
			if (!i) {
				var n = this.jE.kw(this.ht[t]);
				this._points.push(n)
			}
		}
	}
}),
T.SVG.M({
	pointsToPathEX: function(t, i) {
		var e, s, n, o, h, r, a = "";
		for (e = 0, n = t.length; e < n; e++) {
			for (h = t[e], s = 0, o = h.length; s < o; s++) r = h[s],
			a += T.oQ.MT ? (s ? "L": "M") + +r.x + " " + r.y: (s ? "L": "M") + +Math.floor(r.x) + " " + Math.floor(r.y);
			a += i ? T.oQ.MT ? "z": "x": ""
		}
		return a || "M0 0"
	},
	calculateVector: function(t, i, e) {
		i || (i = Math.PI / 2),
		e || (e = 1);
		var s, n, o, h, r, a, l = Math.sqrt(t.x * t.x + t.y * t.y);
		if (0 == t.y) s = n = l * e * Math.cos(i) / t.x,
		t.x > 0 ? (o = Math.sqrt(e * e - s * s), h = -o) : t.x < 0 && (h = Math.sqrt(e * e - s * s), o = -h),
		r = new T.Point(s, o),
		a = new T.Point(n, h);
		else {
			var u = -t.x / t.y,
			c = e * l * Math.cos(i) / t.y,
			i = 1 + u * u,
			f = 2 * u * c,
			p = c * c - e * e;
			s = (-f - Math.sqrt(f * f - 4 * i * p)) / (2 * i),
			n = (-f + Math.sqrt(f * f - 4 * i * p)) / (2 * i),
			o = u * s + c,
			h = u * n + c,
			t.y >= 0 ? (r = new T.Point(s, o), a = new T.Point(n, h)) : t.y < 0 && (r = new T.Point(n, h), a = new T.Point(s, o))
		}
		return [r, a]
	},
	calculateMidpoint: function(t, i) {
		var e = new T.Point((t.x + i.x) / 2, (t.y + i.y) / 2);
		return e
	},
	calculateIntersection: function(t, i, e, s) {
		var n, o;
		return t.y * i.x - t.x * i.y == 0 ? t.x * i.x > 0 || t.y * i.y > 0 ? (n = (e.x + s.x) / 2, o = (e.y + s.y) / 2) : (n = s.x, o = s.y) : (n = (t.x * i.x * (s.y - e.y) + e.x * t.y * i.x - s.x * i.y * t.x) / (t.y * i.x - t.x * i.y), o = 0 != t.x ? (n - e.x) * t.y / t.x + e.y: (n - s.x) * i.y / i.x + s.y),
		new T.Point(n, o)
	},
	calculateAngle: function(t, i) {
		var e = Math.atan2(t.y - i.y, t.x - i.x);
		return e < 0 && (e += 2 * Math.PI),
		e
	},
	calculateDistance: function(t, i) {
		var e = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2));
		return e
	},
	cloneControlPoints: function(t) {
		for (var i = [], e = 0; e < t.length; e++) i.push(t[e].pQ());
		return i
	},
	calculateArc: function(t, i, e, s, n, o) { (!n || 1 != n && n != -1) && (n = -1),
		o || (o = 360);
		for (var h = Math.PI / o / 2,
		r = h * n,
		a = Math.abs(s - e), l = [], u = e, c = 0; c < a; c += h) {
			var f = new T.Point(Math.cos(u) * i + t.x, Math.sin(u) * i + t.y);
			l.push(f),
			u += r,
			u = u < 0 ? u + 2 * Math.PI: u,
			u = u > 2 * Math.PI ? u - 2 * Math.PI: u
		}
		return l
	},
	createCloseCardinal: function(t) {
		if (null == t || t.length < 3) return t;
		var i = t[0];
		t.push(i);
		for (var e = t,
		s = [], n = .4, o = .005, h = e.length - 1, r = 0; r <= h - 1; r++) {
			if (r == h - 1) var a = e[h - 1],
			l = e[0],
			u = e[1];
			else var a = e[r],
			l = e[r + 1],
			u = e[r + 2];
			var c = new T.Point,
			f = new T.Point,
			p = new T.Point(l.x - a.x, l.y - a.y),
			d = new T.Point(u.x - l.x, u.y - l.y),
			y = Math.sqrt(p.x * p.x + p.y * p.y),
			g = Math.sqrt(d.x * d.x + d.y * d.y),
			m = new T.Point(p.x / y, p.y / y),
			v = new T.Point(d.x / g, d.y / g),
			w = new T.Point(m.x + v.x, m.y + v.y),
			E = Math.sqrt(w.x * w.x + w.y * w.y),
			x = new T.Point(w.x / E, w.y / E),
			P = (m.x * v.x + m.y * v.y) / 1;
			Math.abs(1 - P) < o ? (c.x = l.x - v.x * y * n, c.y = l.y - v.y * y * n, f.x = l.x + m.x * g * n, f.y = l.y + m.y * g * n) : (c.x = l.x - x.x * y * n, c.y = l.y - x.y * y * n, f.x = l.x + x.x * g * n, f.y = l.y + x.y * g * n),
			r == h - 1 ? (s[0] = l, s[1] = f, s[3 * (h - 2) + 2 + 3] = c, s[3 * (h - 2) + 2 + 4] = e[h]) : (s[3 * r + 2 + 0] = c, s[3 * r + 2 + 1] = l, s[3 * r + 2 + 2] = f)
		}
		return s
	},
	calculateCardinalPoints: function(t) {
		if (null == t || t.length < 3) return t;
		for (var i = t,
		e = [], s = .4, n = .5, o = .005, h = i.length - 1, r = 0; r <= h + 1 - 3; r++) {
			var a = i[r],
			l = i[r + 1],
			u = i[r + 2],
			c = new T.Point,
			f = new T.Point,
			p = new T.Point(l.x - a.x, l.y - a.y),
			d = new T.Point(u.x - l.x, u.y - l.y),
			y = Math.sqrt(p.x * p.x + p.y * p.y),
			g = Math.sqrt(d.x * d.x + d.y * d.y),
			m = new T.Point(p.x / y, p.y / y),
			v = new T.Point(d.x / g, d.y / g),
			w = new T.Point(m.x + v.x, m.y + v.y),
			E = Math.sqrt(w.x * w.x + w.y * w.y),
			x = new T.Point(w.x / E, w.y / E),
			P = (m.x * v.x + m.y * v.y) / 1;
			if (Math.abs(1 - P) < o ? (c.x = l.x - v.x * y * s, c.y = l.y - v.y * y * s, f.x = l.x + m.x * g * s, f.y = l.y + m.y * g * s) : (c.x = l.x - x.x * y * s, c.y = l.y - x.y * y * s, f.x = l.x + x.x * g * s, f.y = l.y + x.y * g * s), e[3 * r + 2 + 0] = c, e[3 * r + 2 + 1] = l, e[3 * r + 2 + 2] = f, 0 == r) {
				var O = new T.Point,
				L = new T.Point(c.x - a.x, c.y - a.y),
				S = Math.sqrt(L.x * L.x + L.y * L.y),
				Q = new T.Point(L.x / S, L.y / S);
				O.x = a.x + Q.x * y * s * n,
				O.y = a.y + Q.y * y * s * n,
				e[3 * r + 0] = a,
				e[3 * r + 1] = O
			}
			if (r == h + 1 - 3) {
				var A = new T.Point,
				C = new T.Point(f.x - u.x, f.y - u.y),
				M = Math.sqrt(C.x * C.x + C.y * C.y),
				b = new T.Point(C.x / M, C.y / M);
				A.x = u.x + b.x * g * s * n,
				A.y = u.y + b.y * g * s * n,
				e[3 * r + 2 + 3] = A,
				e[3 * r + 2 + 4] = u
			}
		}
		return e
	},
	createBezier1: function(t, i, e) {
		for (var s = [], n = 0; n < t.length; n++) s[n] = t[n];
		for (var o, h, r, a = 0,
		l = s.length,
		u = [], c = !0; c;) {
			for (r = !0, o = 0; o < l - 3; o += 3) {
				if (GetBezierGap(s, o) > i) {
					for (r = !1, InciseBezier(s, o, u), s.splice(o + 1, 2), h = 0; h < 5; h++) s.splice(o + 1 + h, 0, u[h + 1]);
					o -= 3,
					l = s.length
				}
				if (r) break
			}
			for (; a < l - 1;) s[a] === s[a + 1] && (s.splice(a + 1, 1), l--),
			a++;
			c = !1
		}
		return new T.LineString(s)
	},
	calculatePointsFBZ2: function(t, i) {
		i || (i = 20);
		var e = [],
		s = .05;
		i > 0 && (s = 1 / i);
		for (var n = 0; n < t.length - 2;) {
			var o = t[n],
			h = t[n + 1],
			r = t[n + 2];
			e.push(o);
			for (var a = 0; a < 1;) {
				var l = (1 - a) * (1 - a) * o.x + 2 * a * (1 - a) * h.x + a * a * r.x,
				u = (1 - a) * (1 - a) * o.y + 2 * a * (1 - a) * h.y + a * a * r.y,
				c = new T.Point(l, u);
				e.push(c),
				a += s
			}
			n += 2,
			n >= t.length && e.push(o)
		}
		var f = e[e.length - 1],
		p = t[t.length - 1];
		return f.equals(p) || e.push(p.pQ()),
		e
	},
	calculatePointsFBZ3: function(t, i) {
		i || (i = 20);
		var e = [],
		s = .05;
		i > 0 && (s = 1 / i);
		for (var n = 0; n < t.length - 3;) {
			var o = t[n],
			h = t[n + 1],
			r = t[n + 2],
			a = t[n + 3];
			e.push(o);
			for (var l = 0; l < 1;) {
				var u = (1 - l) * (1 - l) * (1 - l) * o.x + 3 * l * (1 - l) * (1 - l) * h.x + 3 * l * l * (1 - l) * r.x + l * l * l * a.x,
				c = (1 - l) * (1 - l) * (1 - l) * o.y + 3 * l * (1 - l) * (1 - l) * h.y + 3 * l * l * (1 - l) * r.y + l * l * l * a.y,
				f = new T.Point(u, c);
				e.push(f),
				l += s
			}
			n += 3,
			n >= t.length && e.push(o)
		}
		var p = e[e.length - 1],
		d = t[t.length - 1];
		return p.equals(d) || e.push(d.pQ()),
		e
	},
	calculateAngularBisector: function(t, i) {
		var e = Math.sqrt(t.x * t.x + t.y * t.y),
		s = Math.sqrt(i.x * i.x + i.y * i.y);
		return new T.Point(t.x / e + i.x / s, t.y / e + i.y / s)
	},
	calculateIntersectionFromTwoCorner: function(t, i, e, s) {
		e || (e = Math.PI / 4),
		s || (s = Math.PI / 4);
		var n = new T.Point(i.x - t.x, i.y - t.y),
		o = this.calculateVector(n, e, 1),
		h = o[0],
		r = o[1],
		a = this.calculateVector(n, Math.PI - e, 1),
		l = a[0],
		u = a[1],
		c = this.calculateIntersection(h, l, t, i),
		f = this.calculateIntersection(r, u, t, i);
		return [c, f]
	},
	InciseBezier: function(t, i, e) {
		var s = [];
		s[0] = [],
		s[1] = [],
		s[2] = [];
		var n;
		for (n = 0; n < 3; n++) s[0][n] = new T.Point,
		s[0][n].x = (t[i + n].x + t[i + n + 1].x) / 2,
		s[0][n].y = (t[i + n].y + t[i + n + 1].y) / 2;
		for (n = 0; n < 2; n++) s[1][n] = new T.Point,
		s[1][n].x = (s[0][n].x + s[0][n + 1].x) / 2,
		s[1][n].y = (s[0][n].y + s[0][n + 1].y) / 2;
		return s[2][0] = new T.Point,
		s[2][0].x = (s[1][0].x + s[1][1].x) / 2,
		s[2][0].y = (s[1][0].y + s[1][1].y) / 2,
		e[0] = t[i],
		e[1] = s[0][0],
		e[2] = s[1][0],
		e[3] = s[2][0],
		e[4] = s[1][1],
		e[5] = s[0][2],
		e[6] = t[i + 3],
		!0
	},
	GetBezierGap: function(t, i) {
		for (var e = 0,
		s = 1; s < 4; s++) Math.abs(t[i + s].x - t[i + s - 1].x) > e && (e = Math.abs(t[i + s].x - t[i + s - 1].x)),
		Math.abs(t[i + s].y - t[i + s - 1].y) > e && (e = Math.abs(t[i + s].y - t[i + s - 1].y));
		return e
	},
	calculateArrowLines: function(t, i, e, s) {
		if (0 == t.distanceTo(i)) return [t, i];
		var n = [];
		e || (e = 10),
		s || (s = Math.PI / 6);
		var o = this.calculateDistance(t, i),
		h = this.toVector(t, i),
		r = this.calculateVector(h, s, o / e),
		a = new T.Point(r[0].x + i.x, r[0].y + i.y),
		l = new T.Point(r[1].x + i.x, r[1].y + i.y);
		return n.push(i),
		n.push(a),
		n.push(i),
		n.push(l),
		n
	},
	toVector: function(t, i) {
		return new T.Point(t.x - i.x, t.y - i.y)
	},
	createBezier1: function(t, i, e) {
		if (e) return this.calculatePointsFBZ3(t, e);
		for (var s = [], n = 0; n < t.length; n++) s[n] = t[n];
		for (var o, h, r, a = 0,
		l = s.length,
		u = [], c = !0; c;) {
			for (r = !0, o = 0; o < l - 3; o += 3) {
				if (this.GetBezierGap(s, o) > i) {
					for (r = !1, this.InciseBezier(s, o, u), s.splice(o + 1, 2), h = 0; h < 5; h++) s.splice(o + 1 + h, 0, u[h + 1]);
					o -= 3,
					l = s.length
				}
				if (r) break
			}
			for (; a < l - 1;) s[a] === s[a + 1] && (s.splice(a + 1, 1), l--),
			a++;
			c = !1
		}
		return s
	}
}),
T.Curve = T.jT.extend({
	options: {},
	initialize: function(t, i) {
		T.setOptions(this, i),
		this.iY(t)
	},
	getPath: function() {
		return this._coords
	},
	setPath: function(t) {
		return this.iY(t),
		this.redraw()
	},
	iY: function(t) {
		this._coords = t
	},
	Oe: function() {
		this.jE && this.rt()
	},
	rt: function() {
		this.bT.tD(this)
	},
	Rt: function() {
		var t, i, e, s;
		this._points = [];
		for (var n = 0; n < this._coords.length; n++) if (t = this._coords[n], "string" == typeof t || t instanceof String) this._points.push(t),
		e = t;
		else {
			switch (t = t instanceof T.dq ? [t.lat, t.lng] : t, t.length) {
			case 2:
				s = this.jE.kw(t),
				i = t;
				break;
			case 1:
				"H" == e ? (s = this.jE.kw([i[0], t[0]]), i = [i[0], t[0]]) : (s = this.jE.kw([t[0], i[1]]), i = [t[0], i[1]])
			}
			this._points.push(s)
		}
	}
}),
T.SVG.M({
	tD: function(t) {
		this.iY(t, this.YD(t._points))
	},
	YD: function(t) {
		for (var i, e, s = "",
		n = 0; n < t.length; n++) if (i = t[n], "string" == typeof i || i instanceof String) e = i,
		"Q" == e && T.oQ.ielt9 && (e = "qb"),
		s += e;
		else switch (e) {
		case "H":
			s += i.x + ",";
			break;
		case "V":
			s += i.y + ",";
			break;
		default:
			s += i.x + "," + i.y + " "
		}
		return (e = T.oQ.ielt9) && (s += " r 0 0 e"),
		s || "M0 0"
	}
}),
T.Arc = T.PathEx.extend({
	rt: function() {
		this.bT.UD(this)
	}
}),
T.SVG.M({
	UD: function(t) {
		this.iY(t, this.uD(t._points))
	},
	uD: function(t, i) {
		var e = "",
		s = this.calculatePartsArc(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e || "M0 0"
	},
	calculatePartsArc: function(t) {
		var i = this.cloneControlPoints(t),
		e = [];
		if (t.length < 3 && (e = i), t.length > 2) {
			var s = i[0],
			n = i[1],
			o = i[2],
			h = this.calculateMidpoint(s, n),
			r = this.calculateMidpoint(n, o),
			a = new T.Point(n.x - s.x, n.y - s.y),
			l = new T.Point(o.x - n.x, o.y - n.y);
			if (Math.abs(a.x * l.y - l.x * a.y) < 1e-5) return void e.push(s, o, n);
			var u, c, f = this.calculateVector(a)[1],
			p = this.calculateVector(l)[1],
			d = this.calculateIntersection(f, p, h, r),
			y = this.calculateDistance(d, s),
			g = this.calculateAngle(s, d),
			m = this.calculateAngle(n, d),
			v = this.calculateAngle(o, d),
			w = Math.PI,
			E = 1,
			x = g,
			P = m;
			g > m ? (x = m, P = g, u = n, c = s) : (u = s, c = n);
			var O = P - x; (v < m && v < g || v > m && v > g) && (E = -1, O = x + (2 * w - P));
			var L = w / 720 / 2,
			S = L * E;
			e.push(u);
			for (var Q = x,
			A = 0; A < O - L; A += L) {
				Q += S,
				Q = Q < 0 ? Q + 2 * w: Q,
				Q = Q > 2 * w ? Q - 2 * w: Q;
				var C = new T.Point(Math.cos(Q) * y + d.x, Math.sin(Q) * y + d.y);
				e.push(C)
			}
			e.push(c)
		}
		return e
	}
}),
T.Arch = T.Arc.extend({
	rt: function() {
		this.bT.ID(this)
	}
}),
T.SVG.M({
	ID: function(t) {
		this.iY(t, this.uD(t._points, !0))
	}
}),
T.Sector = T.PathEx.extend({
	rt: function() {
		this.bT.iD(this)
	}
}),
T.SVG.M({
	iD: function(t) { ! t || !t._points || t._points.length < 2 || this.iY(t, this.OD(t._points, !0))
	},
	OD: function(t, i) {
		var e = "",
		s = this.calculatePartsSector(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e || "M0 0"
	},
	calculateAngle: function(t, i) {
		var e = Math.atan2(t.y - i.y, t.x - i.x);
		return e < 0 && (e += 2 * Math.PI),
		e
	},
	calculatePartsSector: function(t) {
		var i = this.cloneControlPoints(t),
		e = [];
		if (2 == i.length) {
			var s = i[0],
			n = i[1];
			e.push(s),
			e.push(n)
		}
		if (i.length > 2) {
			var o = i[0],
			h = i[1],
			r = i[i.length - 1],
			a = this.calculateDistance(o, h),
			l = this.calculateAngle(h, o),
			u = this.calculateAngle(r, o);
			u < l && (u = 2 * Math.PI + u);
			var t = this.calculateArc(o, a, l, u, 1);
			t.unshift(o),
			e = e.concat(t)
		}
		return e
	}
}),
T.CloseCurve = T.PathEx.extend({
	rt: function() {
		this.bT.oD(this)
	}
}),
T.SVG.M({
	oD: function(t) {
		t && t._points && this.iY(t, this.PD(t._points, !0))
	},
	PD: function(t, i) {
		var e = "",
		s = this.calculatePartsCloseCurve(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculateAngle: function(t, i) {
		var e = Math.atan2(t.y - i.y, t.x - i.x);
		return e < 0 && (e += 2 * Math.PI),
		e
	},
	calculatePartsCloseCurve: function(t) {
		var i = [],
		e = this.cloneControlPoints(t);
		if (e.length > 2) for (var s = 0; s < e.length - 1; s++) if (0 == e[s].distanceTo(e[s + 1])) return e;
		if (this.components = [], e.length <= 2) return e;
		if (e.length > 2) {
			var n = this.createCloseCardinal(e);
			i = i.concat(this.createBezier3(n, 100))
		}
		return i
	},
	createBezier3: function(t, i) {
		var e = this.calculatePointsFBZ3(t, i);
		return e
	}
}),
T.GatheringPlace = T.PathEx.extend({
	rt: function() {
		this.bT.pD(this)
	}
}),
T.SVG.M({
	pD: function(t) { ! t || !t._points || t._points.length < 2 || this.iY(t, this.AD(t._points, !0))
	},
	AD: function(t, i) {
		var e = "",
		s = this.calculatePartsGatheringPlace(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsGatheringPlace: function(t) {
		if (t.length > 2) for (var i = 0; i < t.length - 1; i++) if (0 == t[i].distanceTo(t[i + 1])) return t;
		if (this.components = [], t.length > 1) {
			var e = t[0],
			s = t[t.length - 1],
			n = [],
			o = new T.Point(s.x - e.x, s.y - e.y),
			h = Math.sqrt(o.x * o.x + o.y * o.y),
			r = this.calculateVector(o, Math.PI / 3, Math.sqrt(3) / 12 * h),
			a = r[0],
			l = new T.Point(a.x + e.x, a.y + e.y),
			u = new T.Point((e.x + s.x) / 2, (e.y + s.y) / 2),
			c = this.calculateVector(o, 2 * Math.PI / 3, Math.sqrt(3) / 12 * h),
			f = c[0],
			p = new T.Point(f.x + s.x, f.y + s.y),
			d = this.calculateVector(o, Math.PI / 2, .5 * h),
			y = d[1],
			g = new T.Point(y.x + u.x, y.y + u.y),
			m = e.pQ(),
			v = s.pQ();
			n.push(m, l, u, p, v, g);
			var w = this.createCloseCardinal(n);
			return this.createBezier3(w, 100)
		}
	}
}),
T.RoundRect = T.PathEx.extend({
	style: {
		color: "red",
		weight: 5,
		opacity: .5,
		fillColor: "#0000FF",
		fillOpacity: .2,
		fill: !0
	},
	rt: function() {
		this.bT.aD(this)
	}
}),
T.SVG.M({
	aD: function(t) {
		this.iY(t, this.SD(t._points, !0))
	},
	SD: function(t, i) {
		var e = "",
		s = this.calculatePartsRoundRect(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e || "M0 0"
	},
	calculatePartsRoundRect: function(t) {
		var i = [];
		if (t.length > 1) {
			var e = t[0],
			s = t[t.length - 1],
			n = Math.max(e.x, s.x),
			o = Math.min(e.x, s.x),
			h = Math.max(e.y, s.y),
			r = Math.min(e.y, s.y),
			a = 1 * Math.min(Math.abs(e.x - s.x), Math.abs(e.y - s.y)) / 10,
			l = new T.Point(o + a, h - a),
			u = new T.Point(n - a, h - a),
			c = new T.Point(n - a, r + a),
			f = new T.Point(o + a, r + a),
			p = this.calculateArc(l, a, Math.PI, Math.PI / 2, -1, 180),
			d = this.calculateArc(u, a, Math.PI / 2, 0, -1, 180),
			y = this.calculateArc(c, a, 2 * Math.PI, 3 * Math.PI / 2, -1, 180),
			g = this.calculateArc(f, a, 3 * Math.PI / 2, Math.PI, -1, 180),
			m = p.concat(d, y, g);
			return i = i.concat(m)
		}
	}
}),
T.RectFlag = T.PathEx.extend({
	rt: function() {
		this.bT.sD(this)
	}
}),
T.SVG.M({
	sD: function(t) {
		t && t._points && this.iY(t, this.DD(t._points, !0))
	},
	DD: function(t, i) {
		var e, s = "";
		return e = 1 != t.length ? this.calculatePartsRectFlag(t) : t,
		e && (s = this.pointsToPathEX([e], i)),
		e && (s = this.pointsToPathEX([e], i)),
		s || "M0 0"
	},
	calculatePartsRectFlag: function(t) {
		var i = [];
		if (t.length > 1) {
			var e = t[0],
			s = t[t.length - 1],
			n = e.pQ(),
			o = new T.Point(s.x, e.y),
			h = new T.Point(s.x, (e.y + s.y) / 2),
			r = new T.Point(e.x, (e.y + s.y) / 2),
			a = new T.Point(e.x, s.y);
			return i.push(n),
			i.push(o),
			i.push(h),
			i.push(r),
			i.push(a),
			i
		}
	}
}),
T.CurveFlag = T.PathEx.extend({
	rt: function() {
		this.bT.dD(this)
	}
}),
T.SVG.M({
	dD: function(t) {
		t && t._points && this.iY(t, this.FD(t._points, !0))
	},
	FD: function(t, i) {
		var e, s = "";
		return e = 1 != t.length ? this.calculatePartsCurveFlag(t) : t,
		e && (s = this.pointsToPathEX([e], i)),
		s || "M0 0"
	},
	calculatePartsCurveFlag: function(t) {
		if (t.length > 1) {
			var i = t[0],
			e = t[t.length - 1],
			s = i,
			n = new T.Point((e.x - i.x) / 4 + i.x, (e.y - i.y) / 8 + i.y),
			o = new T.Point((i.x + e.x) / 2, i.y),
			h = new T.Point(3 * (e.x - i.x) / 4 + i.x, -(e.y - i.y) / 8 + i.y),
			r = new T.Point(e.x, i.y),
			a = new T.Point(e.x, (i.y + e.y) / 2),
			l = new T.Point(3 * (e.x - i.x) / 4 + i.x, 3 * (e.y - i.y) / 8 + i.y),
			u = new T.Point((i.x + e.x) / 2, (i.y + e.y) / 2),
			c = new T.Point((e.x - i.x) / 4 + i.x, 5 * (e.y - i.y) / 8 + i.y),
			f = new T.Point(i.x, (i.y + e.y) / 2),
			p = new T.Point(i.x, e.y),
			d = this.calculatePointsFBZN([s, n, o, h, r]),
			y = this.calculatePointsFBZN([a, l, u, c, f]),
			g = d.concat(y);
			return g.push(p),
			g
		}
	}
}),
T.TriangleFlag = T.PathEx.extend({
	rt: function() {
		this.bT.fD(this)
	}
}),
T.SVG.M({
	fD: function(t) {
		t && t._points && this.iY(t, this.GD(t._points, !0))
	},
	GD: function(t, i) {
		var e, s = "";
		return e = 1 != t.length ? this.calculatePartsTriangleFlag(t) : t,
		e && (s = this.pointsToPathEX([e], i)),
		e && (s = this.pointsToPathEX([e], i)),
		s || "M0 0"
	},
	calculatePartsTriangleFlag: function(t) {
		var i = [];
		if (t.length > 1) {
			var e = t[0],
			s = t[t.length - 1],
			n = e.pQ(),
			o = new T.Point(s.x, (e.y + s.y) / 2),
			h = new T.Point(e.x, (e.y + s.y) / 2),
			r = new T.Point(e.x, s.y);
			return i.push(n),
			i.push(o),
			i.push(h),
			i.push(r),
			i
		}
	}
}),
T.DiagonalArrow = T.PathEx.extend({
	style: {
		color: "red",
		weight: 5,
		opacity: .5,
		fillColor: "#0000FF",
		fillOpacity: .2,
		fill: !0
	},
	rt: function() {
		this.bT.gD(this)
	}
}),
T.SVG.M({
	gD: function(t) {
		this.iY(t, this.HD(t._points, !0))
	},
	HD: function(t, i) {
		var e = "",
		s = this.calculatePartsDiagonalArrow1(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsDiagonalArrow1: function(t) {
		if (! (null == t || t.length < 2 || 2 == t.length && t[0].equals(t[1]))) return this.components = [],
		2 == t.length ? this.calculateTwoPointsDiagonalArrow1(t) : this.calculateMorePointsDiagonalArrow1(t)
	},
	calculateTwoPointsDiagonalArrow1: function(t) {
		var i = this.cloneControlPoints(t),
		e = i[0],
		s = i[1],
		n = Math.sqrt((s.y - e.y) * (s.y - e.y) + (s.x - e.x) * (s.x - e.x)),
		o = n / 6,
		h = e.x + 5 * (s.x - e.x) / 6,
		r = e.y + 5 * (s.y - e.y) / 6,
		a = (new T.Point(h, r), this.calculateVector(new T.Point(s.x - e.x, s.y - e.y), Math.PI / 2, o / 2)),
		l = a[0],
		u = a[1],
		c = new T.Point(l.x + e.x, l.y + e.y),
		f = new T.Point(u.x + e.x, u.y + e.y),
		p = new T.Point(l.x / 6 + h, l.y / 6 + r),
		d = new T.Point(u.x / 6 + h, u.y / 6 + r),
		y = new T.Point(2 * p.x - d.x, 2 * p.y - d.y),
		g = new T.Point(2 * d.x - p.x, 2 * d.y - p.y);
		return [c, p, y, s, g, d, f]
	},
	calculateMorePointsDiagonalArrow1: function(t) {
		for (var i = this.cloneControlPoints(t), e = 0, s = 0, n = 0; n < i.length - 1; n++) {
			var o = i[n],
			h = i[n + 1];
			e += Math.sqrt((h.y - o.y) * (h.y - o.y) + (h.x - o.x) * (h.x - o.x))
		}
		s = e / 6;
		for (var r = Math.atan(s / (2 * e)), a = [], l = [], u = new T.Point, c = new T.Point, f = 0; f < i.length - 2; f++) {
			var p = i[f],
			d = i[f + 1],
			y = i[f + 2],
			g = new T.Point(d.x - p.x, d.y - p.y),
			m = new T.Point(y.x - d.x, y.y - d.y),
			v = new T.Point,
			w = new T.Point;
			if (0 == f) {
				var E = this.calculateVector(g, Math.PI / 2, s / 2),
				x = E[0],
				P = E[1];
				u = v = new T.Point(x.x + p.x, x.y + p.y),
				c = w = new T.Point(P.x + p.x, P.y + p.y)
			} else v = a[a.length - 1],
			w = l[l.length - 1];
			var O = this.calculateVector(g, r, 1),
			L = O[1],
			S = O[0],
			Q = this.calculateAngularBisector(new T.Point(-g.x, -g.y), m),
			A = this.calculateIntersection(L, Q, v, d),
			C = this.calculateIntersection(S, Q, w, d);
			a.push(new T.Point((v.x + A.x) / 2, (v.y + A.y) / 2)),
			a.push(A),
			l.push(new T.Point((w.x + C.x) / 2, (w.y + C.y) / 2)),
			l.push(C)
		}
		var M = i[i.length - 2],
		b = i[i.length - 1],
		I = Math.sqrt((M.x - b.x) * (M.x - b.x) + (M.y - b.y) * (M.y - b.y)),
		q = new T.Point,
		_ = new T.Point,
		j = [],
		R = new T.Point,
		Y = new T.Point,
		W = new T.Point,
		D = new T.Point,
		k = a[a.length - 1],
		U = l[l.length - 1],
		z = new T.Point,
		B = new T.Point;
		if (I <= s) j = this.calculateVector(new T.Point(b.x - M.x, b.y - M.y), Math.PI / 2, s / 2),
		z = j[0],
		B = j[1],
		q = new T.Point(z.x / 6 + M.x, z.y / 6 + M.y),
		_ = new T.Point(B.x / 6 + M.x, B.y / 6 + M.y),
		W = new T.Point(2 * q.x - _.x, 2 * q.y - _.y),
		D = new T.Point(2 * _.x - q.x, 2 * _.y - q.y),
		R = new T.Point((k.x + q.x) / 2, (k.y + q.y) / 2),
		Y = new T.Point((U.x + _.x) / 2, (U.y + _.y) / 2),
		a.push(R),
		l.push(Y);
		else {
			var N = new T.Point(b.x - M.x, b.y - M.y),
			Z = Math.sqrt(N.x * N.x + N.y * N.y),
			F = new T.Point(b.x - N.x * s / Z, b.y - N.y * s / Z);
			j = this.calculateVector(new T.Point(b.x - F.x, b.y - F.y), Math.PI / 2, s / 2),
			z = j[0],
			B = j[1],
			q = new T.Point(z.x / 6 + F.x, z.y / 6 + F.y),
			_ = new T.Point(B.x / 6 + F.x, B.y / 6 + F.y),
			W = new T.Point(2 * q.x - _.x, 2 * q.y - _.y),
			D = new T.Point(2 * _.x - q.x, 2 * _.y - q.y),
			R = new T.Point((k.x + q.x) / 2, (k.y + q.y) / 2),
			Y = new T.Point((U.x + _.x) / 2, (U.y + _.y) / 2),
			a.push(R),
			l.push(Y)
		}
		var G = this.calculatePointsFBZ2(a),
		H = this.calculatePointsFBZ2(l),
		V = [u];
		V = V.concat(G),
		V.push(q),
		V.push(W),
		V.push(b),
		V.push(D),
		V.push(_);
		for (var K = H.length - 1; K >= 0; K--) V.push(H[K]);
		return V.push(c),
		V
	}
}),
T.StraightArrow = T.PathEx.extend({
	style: {
		color: "red",
		weight: 5,
		opacity: .5,
		fillColor: "#0000FF",
		fillOpacity: .2,
		fill: !0
	},
	rt: function() {
		this.bT.hD(this)
	}
}),
T.SVG.M({
	hD: function(t) {
		this.iY(t, this.JD(t._points, !0))
	},
	JD: function(t, i) {
		var e = "",
		s = this.calculatePartsStraightArrow(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e || "M0 0"
	},
	calculatePartsStraightArrow: function(t) {
		if (! (null == t || t.length < 2 || 2 == t.length && t[0].equals(t[1]))) return this.components = [],
		2 == t.length ? this.calculateTwoPointsStraightArrow(t) : this.calculateMorePointsStraightArrow(t)
	},
	calculateTwoPointsStraightArrow: function(t) {
		var i = this.cloneControlPoints(t),
		e = i[0],
		s = i[1],
		n = Math.sqrt((s.y - e.y) * (s.y - e.y) + (s.x - e.x) * (s.x - e.x)),
		o = n / 6,
		h = e.x + 5 * (s.x - e.x) / 6,
		r = e.y + 5 * (s.y - e.y) / 6,
		a = this.calculateVector(new T.Point(s.x - e.x, s.y - e.y), Math.PI / 2, o / 2),
		l = a[0],
		u = a[1],
		c = new T.Point(e.x + l.x, e.y + l.y),
		f = new T.Point(h + c.x - e.x, r + c.y - e.y),
		p = new T.Point(2 * f.x - h, 2 * f.y - r),
		d = new T.Point(s.x, s.y),
		y = new T.Point(e.x + u.x, e.y + u.y),
		g = new T.Point(h + y.x - e.x, r + y.y - e.y),
		m = new T.Point(2 * g.x - h, 2 * g.y - r);
		return [c, f, p, d, m, g, y]
	},
	calculateMorePointsStraightArrow: function(t) {
		for (var i = this.cloneControlPoints(t), e = 0, s = 0, n = 0; n < i.length - 1; n++) {
			var o = i[n],
			h = i[n + 1];
			e += Math.sqrt((h.y - o.y) * (h.y - o.y) + (h.x - o.x) * (h.x - o.x))
		}
		s = e / 6;
		for (var r = [], a = [], l = T.Point(), u = T.Point(), c = 0; c < i.length - 2; c++) {
			var f, p, d = i[c],
			y = i[c + 1],
			g = i[c + 2],
			m = new T.Point(y.x - d.x, y.y - d.y),
			v = new T.Point(g.x - y.x, g.y - y.y),
			w = this.calculateVector(m, Math.PI / 2, s / 2),
			E = w[0],
			x = w[1],
			P = this.calculateVector(v, Math.PI / 2, s / 2),
			O = P[0],
			L = P[1],
			S = new T.Point(d.x + E.x, d.y + E.y),
			Q = new T.Point(d.x + x.x, d.y + x.y),
			A = new T.Point(y.x + O.x, y.y + O.y),
			C = new T.Point(y.x + L.x, y.y + L.y),
			M = this.calculateIntersection(m, v, S, A),
			b = this.calculateIntersection(m, v, Q, C);
			if (0 == c) l = S,
			u = Q,
			f = new T.Point((l.x + M.x) / 2, (l.y + M.y) / 2),
			p = new T.Point((u.x + b.x) / 2, (u.y + b.y) / 2),
			r.push(f),
			a.push(p);
			else {
				var I = r[r.length - 1],
				q = a[a.length - 1];
				f = new T.Point((I.x + M.x) / 2, (I.y + M.y) / 2),
				p = new T.Point((q.x + b.x) / 2, (q.y + b.y) / 2),
				r.push(f),
				a.push(p)
			}
			r.push(M),
			a.push(b)
		}
		var _, j, R = i[i.length - 2],
		Y = i[i.length - 1],
		W = new T.Point(Y.x - R.x, Y.y - R.y),
		D = Math.sqrt(W.x * W.x + W.y * W.y),
		k = [],
		U = T.Point(),
		z = T.Point(),
		B = T.Point(),
		N = T.Point(),
		Z = T.Point(),
		F = T.Point(),
		G = r[r.length - 1],
		H = a[a.length - 1];
		if (D <= s) k = this.calculateVector(W, Math.PI / 2, s / 2),
		U = k[0],
		z = k[1],
		_ = new T.Point(R.x + U.x, R.y + U.y),
		j = new T.Point(R.x + z.x, R.y + z.y),
		B = new T.Point((G.x + _.x) / 2, (G.y + _.y) / 2),
		N = new T.Point((H.x + j.x) / 2, (H.y + j.y) / 2),
		r.push(B),
		a.push(N),
		Z = new T.Point(2 * _.x - R.x, 2 * _.y - R.y),
		F = new T.Point(2 * j.x - R.x, 2 * j.y - R.y);
		else {
			var V = new T.Point(Y.x - R.x, Y.y - R.y),
			K = Math.sqrt(V.x * V.x + V.y * V.y),
			J = new T.Point(Y.x - V.x * s / K, Y.y - V.y * s / K);
			k = this.calculateVector(W, Math.PI / 2, s / 2),
			U = k[0],
			z = k[1],
			_ = new T.Point(J.x + U.x, J.y + U.y),
			j = new T.Point(J.x + z.x, J.y + z.y),
			B = new T.Point((G.x + _.x) / 2, (G.y + _.y) / 2),
			N = new T.Point((H.x + j.x) / 2, (H.y + j.y) / 2),
			r.push(B),
			a.push(N),
			Z = new T.Point(2 * _.x - J.x, 2 * _.y - J.y),
			F = new T.Point(2 * j.x - J.x, 2 * j.y - J.y)
		}
		var X = this.calculatePointsFBZ2(r),
		$ = this.calculatePointsFBZ2(a),
		tt = [l];
		return tt = tt.concat(X),
		tt.push(_),
		tt.push(Z),
		tt.push(Y),
		tt.push(F),
		tt.push(j),
		tt = tt.concat($.reverse()),
		tt.push(u),
		tt
	}
}),
T.BezierCurve2 = T.Curve.extend({
	initialize: function(t, i) {
		this.plnglats = t,
		T.setOptions(this, i);
		var e = this.jD(t);
		T.Curve.prototype.initialize.call(this, e, i)
	},
	setLngLats: function(t) {
		this.plnglats = t;
		var i = this.jD(t);
		this.iY(i),
		this.redraw()
	},
	getLngLats: function() {
		return this.plnglats
	},
	jD: function(t) {
		for (var i = [], e = [], s = 0; s < t.length; s++) t[s] instanceof T.dq ? e.push([t[s].getLat(), t[s].getLng()]) : e.push(t[s]);
		return 1 == e.length ? i = ["M", e[0], T.oQ.MT ? "z": "x"] : 2 == t.length ? i = ["M", e[0], "L", e[1], T.oQ.MT ? "z": "x"] : 3 == t.length && (i = ["M", e[0], "Q", e[1], e[2]]),
		i
	}
}),
T.BezierCurve3 = T.BezierCurve2.extend({
	jD: function(t) {
		for (var i = [], e = this.plnglats = [], s = 0; s < t.length; s++) t[s] instanceof T.dq ? e.push([t[s].getLat(), t[s].getLng()]) : e.push(t[s]);
		return 1 == e.length ? i = ["M", e[0], T.oQ.MT ? "z": "x"] : 2 == t.length ? i = ["M", e[0], "L", e[1], T.oQ.MT ? "z": "x"] : 3 == t.length ? i = ["M", e[0], "Q", e[1], e[2]] : 4 == t.length && (i = ["M", t[0], "C", t[1], t[2], t[3]]),
		i
	}
}),
T.BezierCurveArrow = T.PathEx.extend({
	rt: function() {
		this.bT.KD(this)
	}
}),
T.SVG.M({
	KD: function(t) {
		this.iY(t, this.kD(t._points))
	},
	kD: function(t) {
		var i = "",
		e = this.calculateBezierCurveArrow(t);
		return e && (i = this.pointsToPathEX([e])),
		i || "M0 0"
	},
	calculateBezierCurveArrow: function(t) {
		var i = this.cloneControlPoints(t),
		e = [];
		if (2 == i.length) {
			var s = i[0],
			n = i[1];
			e.push(s),
			e.push(n);
			var o = this.calculateArrowLines(s, n, 10);
			e = e.concat(o)
		} else if (3 == i.length) {
			var s = i[1],
			n = i[2],
			h = this.calculatePointsFBZ2(i),
			o = this.calculateArrowLines(s, n, 10);
			e = e.concat(h),
			e = e.concat(o)
		} else if (4 == i.length) {
			var s = i[2],
			n = i[3],
			r = this.createBezier3(i),
			o = this.calculateArrowLines(s, n, 10);
			e = e.concat(r),
			e = e.concat(o)
		} else if (i.length > 4) {
			var s = i[i.length - 2],
			n = i[i.length - 1],
			a = this.calculatePointsFBZN(i),
			o = this.calculateArrowLines(s, n, 10);
			e = e.concat(a),
			e = e.concat(o)
		}
		return e
	}
}),
T.BezierCurveN = T.PathEx.extend({
	rt: function() {
		this.bT.TD(this)
	}
}),
T.SVG.M({
	TD: function(t) {
		this.iY(t, this.LD(t._points))
	},
	LD: function(t) {
		var i = "",
		e = this.calculatePointsFBZN(t);
		return i = this.pointsToPathEX([e]),
		i || "M0 0"
	},
	calculatePointsFBZN: function(t, i) {
		i || (i = 8 * t.length);
		var e = [],
		s = .05;
		i > 0 && (s = 1 / i);
		for (var n = 0; n <= 1;) {
			for (var o = 0,
			h = 0,
			r = t.length,
			a = 0; a < t.length; a++) {
				var l = this.BEZ(r - 1, a, n);
				o += t[a].x * l,
				h += t[a].y * l
			}
			var u = new T.Point(o, h);
			e.push(u),
			n += s
		}
		var c = e[e.length - 1],
		f = t[t.length - 1];
		return c.equals(f) || e.push(f.pQ()),
		e
	},
	BEZ: function(t, i, e) {
		return this.combSort(t, i) * Math.pow(e, i) * Math.pow(1 - e, t - i)
	},
	combSort: function(t, i) {
		var e = this.factorial(t),
		s = this.factorial(i) * this.factorial(t - i);
		return e / s
	},
	factorial: function(t) {
		for (var i = 1,
		e = 1; e <= t; e++) i *= e;
		return i
	}
}),
T.CardinalCurve = T.PathEx.extend({
	rt: function() {
		this.bT.lD(this)
	}
}),
T.SVG.M({
	lD: function(t) { ! t || !t._points || t._points.length < 2 || this.iY(t, this.ZD(t._points))
	},
	ZD: function(t, i) {
		var e = "",
		s = this.calculatePartsCardinalCurve(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculateAngle: function(t, i) {
		var e = Math.atan2(t.y - i.y, t.x - i.x);
		return e < 0 && (e += 2 * Math.PI),
		e
	},
	calculatePartsCardinalCurve: function(t) {
		var i = this.cloneControlPoints(t);
		if (i.length < 3) return i;
		if (i.length > 2) {
			var e = this.calculateCardinalPoints(i);
			this.part || (this.part = 10 * e.length);
			var s = this.calculatePointsFBZ3(e);
			return s
		}
	}
}),
T.CardinalCurveArrow = T.PathEx.extend({
	rt: function() {
		this.bT.CD(this)
	}
}),
T.SVG.M({
	CD: function(t) {
		this.iY(t, this.VD(t._points))
	},
	VD: function(t) {
		var i = "",
		e = this.calculateCardinalCurveArrow(t);
		return e && (i = this.pointsToPathEX([e])),
		i || "M0 0"
	},
	calculateCardinalCurveArrow: function(t) {
		var i = this.cloneControlPoints(t),
		e = [];
		if (2 == i.length) {
			var s = i[0],
			n = i[1],
			o = [s, n],
			h = this.calculateArrowLines(s, n, 10);
			e = e.concat(o),
			e = e.concat(h)
		} else if (i.length > 2) {
			var r = this.calculateCardinalPoints(i),
			a = this.calculatePointsFBZN(r),
			s = r[r.length - 2],
			n = r[r.length - 1],
			h = this.calculateArrowLines(s, n, 2);
			e = e.concat(a),
			e = e.concat(h)
		}
		return e
	}
}),
T.DoubleArrow = T.PathEx.extend({
	style: {
		color: "#0000FF",
		weight: 5,
		opacity: .5,
		fillColor: "#0000FF",
		fillOpacity: .2,
		fill: !0
	},
	rt: function() {
		this.bT._updateDoubleArrow(this)
	}
}),
T.SVG.M({
	_updateDoubleArrow: function(t) {
		this.iY(t, this.cD(t._points, !0))
	},
	cD: function(t, i) {
		var e = "",
		s = this.calculatePartsDoubleArrow1(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsDoubleArrow1: function(t) {
		var i = this.cloneControlPoints(t);
		if (null == t || t.length < 3) return 2 == i.length ? i: void 0;
		if (3 == i.length) {
			var e = i[1].x - i[0].x,
			s = i[1].y - i[0].y,
			n = new T.Point(i[2].x - e, i[2].y - s);
			i.push(n)
		}
		var o = i[0],
		h = i[1],
		r = i[2],
		a = i[3],
		l = new T.Point((5 * (o.x + h.x) + (r.x + a.x)) / 12, (5 * (o.y + h.y) + (r.y + a.y)) / 12),
		u = this.calculateIntersectionFromTwoCorner(o, a, Math.PI / 8, Math.PI / 6)[0],
		c = this.calculateIntersectionFromTwoCorner(l, a, Math.PI / 8, Math.PI / 16)[0],
		f = this.calculateIntersectionFromTwoCorner(h, r, Math.PI / 8, Math.PI / 6)[1],
		p = this.calculateIntersectionFromTwoCorner(l, r, Math.PI / 8, Math.PI / 16)[1],
		d = new T.Point(u.x - a.x, u.y - a.y),
		y = Math.sqrt(d.x * d.x + d.y * d.y),
		g = new T.Point(d.x / y, d.y / y),
		m = new T.Point(c.x - a.x, c.y - a.y),
		v = Math.sqrt(m.x * m.x + m.y * m.y),
		w = new T.Point(m.x / v, m.y / v),
		E = .25,
		x = y < v ? y * E: v * E,
		P = new T.Point(g.x * x + a.x, g.y * x + a.y),
		O = new T.Point(w.x * x + a.x, w.y * x + a.y),
		L = new T.Point(1.5 * P.x - .5 * O.x, 1.5 * P.y - .5 * O.y),
		S = new T.Point(1.5 * O.x - .5 * P.x, 1.5 * O.y - .5 * P.y),
		Q = new T.Point(f.x - r.x, f.y - r.y),
		A = Math.sqrt(Q.x * Q.x + Q.y * Q.y),
		C = new T.Point(Q.x / A, Q.y / A),
		M = new T.Point(p.x - r.x, p.y - r.y),
		b = Math.sqrt(M.x * M.x + M.y * M.y),
		I = new T.Point(M.x / b, M.y / b),
		q = A < b ? A * E: b * E,
		_ = new T.Point(C.x * q + r.x, C.y * q + r.y),
		j = new T.Point(I.x * q + r.x, I.y * q + r.y),
		R = new T.Point(1.5 * _.x - .5 * j.x, 1.5 * _.y - .5 * j.y),
		Y = new T.Point(1.5 * j.x - .5 * _.x, 1.5 * j.y - .5 * _.y),
		W = this.calculatePointsFBZ2([o, u, P]),
		D = new T.Point(r.x - a.x, r.y - a.y),
		k = new T.Point(l.x - a.x, l.y - a.y),
		U = Math.sqrt(k.x * k.x + k.y * k.y),
		z = new T.Point(l.x - r.x, l.y - r.y),
		B = Math.sqrt(z.x * z.x + z.y * z.y),
		N = .4,
		Z = new T.Point(D.x * N, D.y * N),
		F = new T.Point(Z.x * U / (U + B), Z.y * U / (U + B)),
		G = new T.Point(Z.x * B / (U + B), Z.y * B / (U + B)),
		H = new T.Point(l.x - F.x, l.y - F.y),
		V = new T.Point(l.x + G.x, l.y + G.y),
		K = [O, c, H, l, V, p, j],
		J = this.createBezier1(K, 0, 20),
		X = this.calculatePointsFBZ2([_, f, h]),
		$ = W;
		return $.push(L),
		$.push(a),
		$.push(S),
		$ = $.concat(J),
		$.push(Y),
		$.push(r),
		$.push(R),
		$ = $.concat(X)
	}
}),
T.DoveTailDiagonalArrow = T.PathEx.extend({
	rt: function() {
		this.bT.BD(this)
	}
}),
T.SVG.M({
	BD: function(t) {
		this.iY(t, this.vD(t._points, !0))
	},
	vD: function(t, i) {
		var e = "",
		s = this.calculatePartsDoveTailDiagonalArrow(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsDoveTailDiagonalArrow: function(t) {
		if (! (null == t || t.length < 2 || 2 == t.length && t[0].equals(t[1]))) return 2 == t.length ? this.calculateTwoPointsDoveTailDiagonalArrow(t) : this.calculateMorePointsDoveTailDiagonalArrow(t)
	},
	calculateTwoPointsDoveTailDiagonalArrow: function(t) {
		var i = this.cloneControlPoints(t),
		e = i[0],
		s = i[1],
		n = Math.sqrt((s.y - e.y) * (s.y - e.y) + (s.x - e.x) * (s.x - e.x)),
		o = n / 6,
		h = e.x + 5 * (s.x - e.x) / 6,
		r = e.y + 5 * (s.y - e.y) / 6,
		a = (new T.Point(h, r), this.calculateVector(new T.Point(s.x - e.x, s.y - e.y), Math.PI / 2, o / 2)),
		l = a[0],
		u = a[1],
		c = new T.Point(l.x + e.x, l.y + e.y),
		f = new T.Point(u.x + e.x, u.y + e.y),
		p = new T.Point((s.x - e.x) / 5 + e.x, (s.y - e.y) / 5 + e.y),
		d = new T.Point(l.x / 6 + h, l.y / 6 + r),
		y = new T.Point(u.x / 6 + h, u.y / 6 + r),
		g = new T.Point(2 * d.x - y.x, 2 * d.y - y.y),
		m = new T.Point(2 * y.x - d.x, 2 * y.y - d.y);
		return [p, c, d, g, s, m, y, f]
	},
	calculateMorePointsDoveTailDiagonalArrow: function(t) {
		for (var i, e = this.cloneControlPoints(t), s = 0, n = 0, o = 0; o < e.length - 1; o++) {
			var h = e[o],
			r = e[o + 1];
			s += Math.sqrt((r.y - h.y) * (r.y - h.y) + (r.x - h.x) * (r.x - h.x)),
			0 == o && (i = new T.Point((r.x - h.x) / 5 + h.x, (r.y - h.y) / 5 + h.y))
		}
		n = s / 6;
		for (var a = Math.atan(n / (2 * s)), l = [], u = [], c = new T.Point, f = new T.Point, p = 0; p < e.length - 2; p++) {
			var d = e[p],
			y = e[p + 1],
			g = e[p + 2],
			m = new T.Point(y.x - d.x, y.y - d.y),
			v = new T.Point(g.x - y.x, g.y - y.y),
			w = new T.Point,
			E = new T.Point;
			if (0 == p) {
				var x = this.calculateVector(m, Math.PI / 2, n / 2),
				P = x[0],
				O = x[1];
				c = w = new T.Point(P.x + d.x, P.y + d.y),
				f = E = new T.Point(O.x + d.x, O.y + d.y)
			} else w = l[l.length - 1],
			E = u[u.length - 1];
			var L = this.calculateVector(m, a, 1),
			S = L[1],
			Q = L[0],
			A = this.calculateAngularBisector(new T.Point(-m.x, -m.y), v),
			C = this.calculateIntersection(S, A, w, y),
			M = this.calculateIntersection(Q, A, E, y);
			l.push(new T.Point((w.x + C.x) / 2, (w.y + C.y) / 2)),
			l.push(C),
			u.push(new T.Point((E.x + M.x) / 2, (E.y + M.y) / 2)),
			u.push(M)
		}
		var b = e[e.length - 2],
		I = e[e.length - 1],
		q = Math.sqrt((b.x - I.x) * (b.x - I.x) + (b.y - I.y) * (b.y - I.y)),
		_ = new T.Point,
		j = new T.Point,
		R = [],
		Y = new T.Point,
		W = new T.Point,
		D = new T.Point,
		k = new T.Point,
		U = l[l.length - 1],
		z = u[u.length - 1],
		B = new T.Point,
		N = new T.Point;
		if (q <= n) R = this.calculateVector(new T.Point(I.x - b.x, I.y - b.y), Math.PI / 2, n / 2),
		B = R[0],
		N = R[1],
		_ = new T.Point(B.x / 6 + b.x, B.y / 6 + b.y),
		j = new T.Point(N.x / 6 + b.x, N.y / 6 + b.y),
		D = new T.Point(2 * _.x - j.x, 2 * _.y - j.y),
		k = new T.Point(2 * j.x - _.x, 2 * j.y - _.y),
		Y = new T.Point((U.x + _.x) / 2, (U.y + _.y) / 2),
		W = new T.Point((z.x + j.x) / 2, (z.y + j.y) / 2),
		l.push(Y),
		u.push(W);
		else {
			var Z = new T.Point(I.x - b.x, I.y - b.y),
			F = Math.sqrt(Z.x * Z.x + Z.y * Z.y),
			G = new T.Point(I.x - Z.x * n / F, I.y - Z.y * n / F);
			R = this.calculateVector(new T.Point(I.x - G.x, I.y - G.y), Math.PI / 2, n / 2),
			B = R[0],
			N = R[1],
			_ = new T.Point(B.x / 6 + G.x, B.y / 6 + G.y),
			j = new T.Point(N.x / 6 + G.x, N.y / 6 + G.y),
			D = new T.Point(2 * _.x - j.x, 2 * _.y - j.y),
			k = new T.Point(2 * j.x - _.x, 2 * j.y - _.y),
			Y = new T.Point((U.x + _.x) / 2, (U.y + _.y) / 2),
			W = new T.Point((z.x + j.x) / 2, (z.y + j.y) / 2),
			l.push(Y),
			u.push(W)
		}
		var H = this.calculatePointsFBZ2(l),
		V = this.calculatePointsFBZ2(u),
		K = [c];
		K = K.concat(H),
		K.push(_),
		K.push(D),
		K.push(I),
		K.push(k),
		K.push(j);
		for (var J = V.length - 1; J >= 0; J--) K.push(V[J]);
		return K.push(f),
		K.push(i),
		K
	}
}),
T.DoveTailStraightArrow = T.PathEx.extend({
	style: {
		color: "red",
		weight: 5,
		opacity: .5,
		fillColor: "#0000FF",
		fillOpacity: .2,
		fill: !0
	},
	rt: function() {
		this.bT.ND(this)
	}
}),
T.SVG.M({
	ND: function(t) {
		this.iY(t, this.bD(t._points, !0))
	},
	bD: function(t, i) {
		var e = "",
		s = this.calculatePartsDoveTailStraightArrow(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsDoveTailStraightArrow: function(t) {
		if (! (null == t || t.length < 2 || 2 == t.length && t[0].equals(t[1]))) return this.components = [],
		2 == t.length ? this.calculateTwoPointsDoveTailStraightArrow(t) : this.calculateMorePointsDoveTailStraightArrow(t)
	},
	calculateTwoPointsDoveTailStraightArrow: function(t) {
		var i = this.cloneControlPoints(t),
		e = i[0],
		s = i[1],
		n = Math.sqrt((s.y - e.y) * (s.y - e.y) + (s.x - e.x) * (s.x - e.x)),
		o = n / 6,
		h = e.x + 5 * (s.x - e.x) / 6,
		r = e.y + 5 * (s.y - e.y) / 6,
		a = this.calculateVector(new T.Point(s.x - e.x, s.y - e.y), Math.PI / 2, o / 2),
		l = a[0],
		u = a[1],
		c = new T.Point(e.x + l.x, e.y + l.y),
		f = new T.Point(h + c.x - e.x, r + c.y - e.y),
		p = new T.Point(2 * f.x - h, 2 * f.y - r),
		d = new T.Point(s.x, s.y),
		y = new T.Point(e.x + u.x, e.y + u.y),
		g = new T.Point(h + y.x - e.x, r + y.y - e.y),
		m = new T.Point(2 * g.x - h, 2 * g.y - r),
		v = new T.Point((s.x - e.x) / 5 + e.x, (s.y - e.y) / 5 + e.y);
		return [v, c, f, p, d, m, g, y]
	},
	calculateMorePointsDoveTailStraightArrow: function(t) {
		for (var i, e = this.cloneControlPoints(t), s = 0, n = 0, o = 0; o < e.length - 1; o++) {
			var h = e[o],
			r = e[o + 1];
			s += Math.sqrt((r.y - h.y) * (r.y - h.y) + (r.x - h.x) * (r.x - h.x)),
			0 == o && (i = new T.Point((r.x - h.x) / 5 + h.x, (r.y - h.y) / 5 + h.y))
		}
		n = s / 6;
		for (var a = [], l = [], u = T.Point(), c = T.Point(), f = 0; f < e.length - 2; f++) {
			var p, d, y = e[f],
			g = e[f + 1],
			m = e[f + 2],
			v = new T.Point(g.x - y.x, g.y - y.y),
			w = new T.Point(m.x - g.x, m.y - g.y),
			E = this.calculateVector(v, Math.PI / 2, n / 2),
			x = E[0],
			P = E[1],
			O = this.calculateVector(w, Math.PI / 2, n / 2),
			L = O[0],
			S = O[1],
			Q = new T.Point(y.x + x.x, y.y + x.y),
			A = new T.Point(y.x + P.x, y.y + P.y),
			C = new T.Point(g.x + L.x, g.y + L.y),
			M = new T.Point(g.x + S.x, g.y + S.y),
			b = this.calculateIntersection(v, w, Q, C),
			I = this.calculateIntersection(v, w, A, M);
			if (0 == f) u = Q,
			c = A,
			p = new T.Point((u.x + b.x) / 2, (u.y + b.y) / 2),
			d = new T.Point((c.x + I.x) / 2, (c.y + I.y) / 2),
			a.push(p),
			l.push(d);
			else {
				var q = a[a.length - 1],
				_ = l[l.length - 1];
				p = new T.Point((q.x + b.x) / 2, (q.y + b.y) / 2),
				d = new T.Point((_.x + I.x) / 2, (_.y + I.y) / 2),
				a.push(p),
				l.push(d)
			}
			a.push(b),
			l.push(I)
		}
		var j, R, Y = e[e.length - 2],
		W = e[e.length - 1],
		D = new T.Point(W.x - Y.x, W.y - Y.y),
		k = Math.sqrt(D.x * D.x + D.y * D.y),
		U = [],
		z = T.Point(),
		B = T.Point(),
		N = T.Point(),
		Z = T.Point(),
		F = T.Point(),
		G = T.Point(),
		H = a[a.length - 1],
		V = l[l.length - 1];
		if (k <= n) U = this.calculateVector(D, Math.PI / 2, n / 2),
		z = U[0],
		B = U[1],
		j = new T.Point(Y.x + z.x, Y.y + z.y),
		R = new T.Point(Y.x + B.x, Y.y + B.y),
		N = new T.Point((H.x + j.x) / 2, (H.y + j.y) / 2),
		Z = new T.Point((V.x + R.x) / 2, (V.y + R.y) / 2),
		a.push(N),
		l.push(Z),
		F = new T.Point(2 * j.x - Y.x, 2 * j.y - Y.y),
		G = new T.Point(2 * R.x - Y.x, 2 * R.y - Y.y);
		else {
			var K = new T.Point(W.x - Y.x, W.y - Y.y),
			J = Math.sqrt(K.x * K.x + K.y * K.y),
			X = new T.Point(W.x - K.x * n / J, W.y - K.y * n / J);
			U = this.calculateVector(D, Math.PI / 2, n / 2),
			z = U[0],
			B = U[1],
			j = new T.Point(X.x + z.x, X.y + z.y),
			R = new T.Point(X.x + B.x, X.y + B.y),
			N = new T.Point((H.x + j.x) / 2, (H.y + j.y) / 2),
			Z = new T.Point((V.x + R.x) / 2, (V.y + R.y) / 2),
			a.push(N),
			l.push(Z),
			F = new T.Point(2 * j.x - X.x, 2 * j.y - X.y),
			G = new T.Point(2 * R.x - X.x, 2 * R.y - X.y)
		}
		var $ = this.calculatePointsFBZ2(a),
		tt = this.calculatePointsFBZ2(l),
		it = [u];
		return it = it.concat($),
		it.push(j),
		it.push(F),
		it.push(W),
		it.push(G),
		it.push(R),
		it = it.concat(tt.reverse()),
		it.push(c),
		it.push(i),
		it
	}
}),
T.ParallelSearch = T.PathEx.extend({
	rt: function() {
		this.bT.MD(this)
	}
}),
T.SVG.M({
	MD: function(t) { ! t || !t._points || t._points.length < 2 || this.iY(t, this.nD(t._points))
	},
	nD: function(t, i) {
		var e = "",
		s = this.calculatePartsParallelSearch(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsParallelSearch: function(t) {
		var i = this.cloneControlPoints(t);
		if (i.length > 1) {
			var e, s = i[0],
			n = i[1];
			if (0 == s.distanceTo(n)) return i;
			e = this.toVector(s, n);
			var o = this.calculateVector(e)[0],
			h = !1,
			r = [];
			r.push(s);
			var a = [];
			a.push(s);
			for (var l = 1; l < i.length; l++) {
				h = l % 2 !== 0;
				var u = i[l];
				if (h) {
					var c = r[l - 1].pQ(),
					f = this.calculateIntersection(o, e, u, c),
					T = this.calculateArrowLines(c, f, 15);
					T.push(f),
					a = a.concat(T),
					r.push(f)
				} else {
					var c = r[l - 1],
					f = this.calculateIntersection(e, o, u, c),
					T = this.calculateArrowLines(c, f, 15);
					T.push(f),
					a = a.concat(T),
					r.push(f)
				}
			}
			return a
		}
	}
}),
T.PolylineArrow = T.PathEx.extend({
	rt: function() {
		this.bT._D(this)
	}
}),
T.SVG.M({
	_D: function(t) {
		this.iY(t, this.mD(t._points))
	},
	mD: function(t) {
		var i = "",
		e = this.calculatePolylineArrow(t);
		return e && (i = this.pointsToPathEX([e])),
		i || "M0 0"
	},
	calculatePolylineArrow: function(t) {
		var i = this.cloneControlPoints(t);
		if (this.components = [], i.length > 1) {
			var e = i[i.length - 2],
			s = i[i.length - 1],
			n = this.calculateArrowLines(e, s, 10);
			i = i.concat(n)
		}
		return i
	}
}),
T.SectorSearch = T.PathEx.extend({
	rt: function() {
		this.bT.Qd(this)
	}
}),
T.SVG.M({
	Qd: function(t) {
		t && t._points && this.iY(t, this.qd(t._points, !0))
	},
	qd: function(t, i) {
		var e = "",
		s = this.calculatePartsSectorSearch(t);
		return s && (e = this.pointsToPathEX([s], i)),
		e.indexOf("NaN") > 0 && (e = this.pointsToPathEX([t], i)),
		e || "M0 0"
	},
	calculatePartsSectorSearch: function(t) {
		var i = this.cloneControlPoints(t);
		if (this.components = [], i.length > 1) {
			if (0 == i[0].distanceTo(i[1])) return i;
			var e = [],
			s = i[0],
			n = 2 * s.x,
			o = 2 * s.y,
			h = i[i.length - 1],
			r = s.distanceTo(h),
			a = this.toVector(s, h),
			l = this.calculateVector(a, 4 * Math.PI / 3, r),
			u = l[0],
			c = new T.Point(u.x + s.x, u.y + s.y),
			f = new T.Point(-c.x + n, -c.y + o),
			p = l[1],
			d = new T.Point(p.x + s.x, p.y + s.y),
			y = new T.Point(-d.x + n, -d.y + o),
			g = new T.Point(-h.x + n, -h.y + o),
			m = this.calculateArrowLines(s, h),
			v = this.calculateArrowLines(h, c),
			w = this.calculateArrowLines(c, f),
			E = this.calculateArrowLines(f, d),
			x = this.calculateArrowLines(d, y),
			P = this.calculateArrowLines(y, g),
			O = this.calculateArrowLines(g, s);
			return e.push(s),
			e = e.concat(m),
			e.push(h),
			e = e.concat(v),
			e.push(c),
			e = e.concat(w),
			e.push(f),
			e = e.concat(E),
			e.push(d),
			e = e.concat(x),
			e.push(y),
			e = e.concat(P),
			e.push(g),
			e = e.concat(O),
			e.push(s),
			e
		}
		return i
	}
}),
T.Cmd2BaseTool = T.Tool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .8
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		this.jE = t,
		this.touch = T.oQ.touch && T.oQ.mobile,
		this.mousemove = this.touch ? "touchmove": "mousemove",
		this.mouseFire = this.touch ? "touchend": "click",
		this.layers = i && i.layers ? i.layers: new T.LayerGroup,
		this.jE.addLayer(this.layers),
		this.lnglats = []
	},
	enable: function() {
		this.eU || (this.eU = !0, this.oU())
	},
	disable: function() {
		this.eU && (this.eU = !1, this.Ar())
	},
	open: function() {
		this.enable()
	},
	close: function() {
		this.disable()
	},
	getLayers: function() {
		return this.layers.getLayers()
	},
	clear: function() {
		this.layers.clearLayers()
	},
	oU: function() {
		this.jE && (this.Yt = null, this.jE.on(this.mouseFire, this.pY, this), this.jE.on(this.mousemove, this.Wd, this))
	},
	Ar: function() {
		this.jE && (this.jE.off(this.mouseFire, this.pY, this), this.jE.off(this.mousemove, this.Wd, this), this.jE.getContainer().style.cursor = "", this.Yt && (this.jE.removeLayer(this.Yt), delete this.Yt, this.Yt = null))
	},
	pY: function(t) {
		var t = {
			currentayer: this.Yt,
			allLayers: this.getLayers()
		};
		this.wQ("click", t)
	},
	Wd: function(t) {
		var t = {
			currentayer: this.Yt,
			allLayers: this.getLayers()
		};
		this.wQ("move", t)
	}
}),
T.Cmd3BaseTool = T.Tool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .8
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		this.jE = t,
		this.touch = T.oQ.touch && T.oQ.mobile,
		this.mousemove = this.touch ? "touchmove": "mousemove",
		this.mouseFire = this.touch ? "touchend": "click",
		this.layers = i && i.layers ? i.layers: new T.LayerGroup,
		this.jE.addLayer(this.layers),
		this.lnglats = []
	},
	enable: function() {
		this.eU || (this.eU = !0, this.oU())
	},
	disable: function() {
		this.eU && (this.eU = !1, this.Ar())
	},
	open: function() {
		this.enable()
	},
	close: function() {
		this.disable()
	},
	getLayers: function() {
		return this.layers.getLayers()
	},
	clear: function() {
		this.layers.clearLayers()
	},
	oU: function() {
		this.jE && (this.wd(), this.jE.on(this.mousemove, this.Wd, this), this.jE.on("click", this.Ed, this), this.jE.on("dblclick", this.ed, this), this.jE.on("longpress", this.Rd, this))
	},
	Ar: function() {
		this.jE && (this.rd(), this.jE.off(this.mousemove, this.Wd, this), this.jE.off("click", this.Ed, this), this.jE.off("dblclick", this.ed, this), this.jE.off("longpress", this.ed, this), this.jE.getContainer().style.cursor = "", this.Yt && (this.jE.removeLayer(this.Yt), delete this.Yt, this.Yt = null))
	},
	wd: function() {
		this.isdb = this.jE.isDoubleClickZoom(),
		this.jE.disableDoubleClickZoom()
	},
	rd: function() {
		this.isdb ? this.jE.enableDoubleClickZoom() : this.jE.disableDoubleClickZoom()
	},
	Ed: function(t) {
		clearTimeout(this.TimeFn);
		var i = this;
		this.TimeFn = setTimeout(function() {
			i.pY(t)
		},
		300)
	},
	ed: function(t) { (!T.oQ.MT || t.originalEvent instanceof MouseEvent) && (clearTimeout(this.TimeFn), this.Rd(t))
	},
	Rd: function(t) {
		var t = {
			currentLnglats: this.Yt.getLngLats(),
			currentLayer: this.Yt,
			allLayers: this.getLayers()
		};
		this.wQ("dbclick", t),
		this.jE.getContainer().style.cursor = "",
		this.Yt.getElement().style.cursor = ""
	},
	pY: function(t) {
		var t = {
			currentLnglats: this.Yt.getLngLats(),
			currentLayer: this.Yt,
			allLayers: this.getLayers()
		};
		this.wQ("click", t),
		this.jE.getContainer().style.cursor = "crosshair",
		this.Yt.getElement().style.cursor = "crosshair"
	},
	Wd: function(t) {
		var t = {
			currentLnglats: this.Yt.getLngLats(),
			currentLayer: this.Yt,
			allLayers: this.getLayers()
		};
		this.wQ("move", t)
	}
}),
T.ArcTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "blue",
			weight: 5,
			opacity: .5,
			fillColor: "#0000FF",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i);
		var e = !this.options.style.fill;
		e && (this.options.style = {
			color: this.options.style.color,
			weight: this.options.style.weight,
			opacity: this.options.style.opacity,
			lineStyle: this.options.style.lineStyle
		}),
		this.Arc = e ? T.Arc: T.Arch,
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 2) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new this.Arc(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 3 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new this.Arc(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.CloseCurveTool = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.CloseCurve(this.lnglats, this.options.style), map.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), map.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.CloseCurve(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.GatheringPlaceTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.GatheringPlace(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.GatheringPlace(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.RoundRectTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.RoundRect(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.RoundRect(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.SectorTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 2) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.Sector(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 3 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.Sector(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.BezierCurveArrowTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.BezierCurveArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.BezierCurveArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), T.Cmd3BaseTool.prototype.Rd.call(this, t), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.CardinalCurveArrowTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.CardinalCurveArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.CardinalCurveArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.DiagonalArrowTool = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.DiagonalArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.DiagonalArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.DoubleArrowTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 3) && (this.lnglats = []), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.DoubleArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 4 == this.lnglats.length) {
			this.jE.removeLayer(this.Yt);
			var i = new T.DoubleArrow(this.lnglats, this.options.style);
			this.jE.getContainer().style.cursor = "",
			this.layers.addLayer(i),
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.DoveTailDiagonalArrowTool = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.DoveTailDiagonalArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.DoveTailDiagonalArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.DoveTailStraightArrowTool = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.DoveTailStraightArrow(this.lnglats, this.options.style), map.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), map.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.DoveTailStraightArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.ParallelSearchTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.ParallelSearch(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.ParallelSearch(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.PolylineArrowTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.PolylineArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.PolylineArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.SectorSearchTool = T.Cmd2BaseTool.extend({
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.SectorSearch(this.lnglats, this.options.style), this.jE.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			this.jE.removeLayer(this.Yt);
			var i = new T.SectorSearch(this.lnglats, this.options.style);
			this.jE.getContainer().style.cursor = "",
			this.layers.addLayer(i),
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.StraightArrowTool = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.StraightArrow(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.StraightArrow(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.BezierCurve2Tool = T.Cmd2BaseTool.extend({
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 2) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.BezierCurve2(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 3 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.BezierCurve2(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.BezierCurve3Tool = T.Cmd2BaseTool.extend({
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 3) && (this.lnglats = []), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.BezierCurve3(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 4 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.BezierCurve3(this.lnglats, this.options.style);
			this.jE.getContainer().style.cursor = "",
			this.layers.addLayer(i),
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.BezierCurveNTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.BezierCurveN(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.BezierCurveN(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), T.Cmd3BaseTool.prototype.Rd.call(this, t), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.CardinalCurveTool = T.Cmd3BaseTool.extend({
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.CardinalCurve(this.lnglats, this.options.style), this.jE.addLayer(this.Yt)),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		if (this.lnglats && 0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd3BaseTool.prototype.Wd.call(this, t)
		}
	},
	Rd: function(t) {
		T.oQ.MT && !t.originalEvent instanceof MouseEvent || !this.lnglats || (T.Cmd3BaseTool.prototype.Rd.call(this, t), this.jE.removeLayer(this.Yt), this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt = new T.CardinalCurve(this.lnglats, this.options.style), this.layers.addLayer(this.Yt), this.Yt = null, delete this.Yt, this.lnglats = null)
	}
}),
T.CurveFlagTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.CurveFlag(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.CurveFlag(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.RectFlagTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.RectFlag(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.RectFlag(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.TriangleFlagTool = T.Cmd2BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		T.Cmd2BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		if ((!this.lnglats || this.lnglats.length > 1) && (this.lnglats = []), this.lnglats.push(t.lnglat), this.Yt ? this.Yt.setLngLats(this.lnglats) : (this.Yt = new T.TriangleFlag(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"), T.Cmd2BaseTool.prototype.pY.call(this, t), 2 == this.lnglats.length) {
			map.removeLayer(this.Yt);
			var i = new T.TriangleFlag(this.lnglats, this.options.style);
			this.layers.addLayer(i),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			delete this.Yt,
			this.Yt = null
		}
	},
	Wd: function(t) {
		if (0 != this.lnglats.length && this.Yt) {
			var i = [];
			i = i.concat(this.lnglats),
			i.push([t.lnglat.lat, t.lnglat.lng]),
			this.Yt.setLngLats(i),
			T.Cmd2BaseTool.prototype.Wd.call(this, t)
		}
	}
}),
T.HandDrawing = T.Cmd3BaseTool.extend({
	options: {
		style: {
			color: "red",
			weight: 5,
			opacity: .5,
			fillColor: "red",
			fillOpacity: .2,
			fill: !0
		}
	},
	initialize: function(t, i) {
		T.setOptions(this, i),
		this.dbClick = this.touch ? "longpress": "dblclick";
		var e = !this.options.style.fill;
		e && (this.options.style = {
			color: this.options.style.color,
			weight: this.options.style.weight,
			opacity: this.options.style.opacity,
			lineStyle: this.options.style.lineStyle
		}),
		this.Poly = e ? T.Polyline: T.Polygon,
		T.Cmd3BaseTool.prototype.initialize.call(this, t, i)
	},
	pY: function(t) {
		this.lnglats || (this.lnglats = []),
		this.lnglats.push([t.lnglat.lat, t.lnglat.lng]),
		this.Yt || (this.Yt = new this.Poly(this.lnglats, this.options.style), map.addLayer(this.Yt), this.jE.getContainer().style.cursor = "crosshair", this.Yt.getElement().style.cursor = "crosshair"),
		T.Cmd3BaseTool.prototype.pY.call(this, t)
	},
	Wd: function(t) {
		this.lnglats && 0 != this.lnglats.length && this.Yt && (this.lnglats.push([t.lnglat.lat, t.lnglat.lng]), this.Yt.setLngLats(this.lnglats), T.Cmd3BaseTool.prototype.Wd.call(this, t))
	},
	Rd: function(t) {
		if (! (T.oQ.MT && !t.originalEvent instanceof MouseEvent) && this.lnglats) {
			T.Cmd3BaseTool.prototype.Rd.call(this, t),
			map.removeLayer(this.Yt);
			var i = this.lnglats.slice(0, this.lnglats.length - 1);
			1 == i.length ? this.jE.centerAndZoom(t.lnglat, map.getZoom() + 1) : (this.Yt = new this.Poly(i, this.options.style), this.layers.addLayer(this.Yt)),
			this.jE.getContainer().style.cursor = "",
			this.Yt.getElement().style.cursor = "",
			this.Yt = null,
			delete this.Yt,
			this.lnglats = null
		}
	}
}),
T.Control.militarySymbols = T.Control.extend({
	options: {},
	datas: {
		flag: {
			name: "军旗",
			subs: {
				CurveFlag: {
					name: "曲线旗",
					handler: T.CurveFlagTool,
					options: {}
				},
				RectFlag: {
					name: "方块旗",
					handler: T.RectFlagTool,
					options: {}
				},
				TriangleFlag: {
					name: "三角旗",
					handler: T.TriangleFlagTool,
					options: {}
				}
			}
		},
		LineMark: {
			name: "绘制线标",
			subs: {
				Bezier2: {
					name: "二次贝塞尔曲线",
					handler: T.BezierCurve2Tool,
					options: {}
				},
				Bezier3: {
					name: "三次贝塞尔曲线",
					handler: T.BezierCurve3Tool,
					options: {}
				},
				BezierN: {
					name: "N次贝塞尔曲线",
					handler: T.BezierCurveNTool,
					options: {}
				},
				CardinalCurve: {
					name: "Cardinal曲线",
					handler: T.CardinalCurveTool,
					options: {}
				},
				Arc: {
					name: "弧",
					handler: T.ArcTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5
						}
					}
				},
				HandDrawing: {
					name: "自由线",
					handler: T.HandDrawing,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5
						}
					}
				}
			}
		},
		SurfaceMark: {
			name: "绘制面标",
			subs: {
				Arc: {
					name: "弓形",
					handler: T.ArcTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				GatheringPlace: {
					name: "聚集区",
					handler: T.GatheringPlaceTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				CloseCurve: {
					name: "闭合曲线",
					handler: T.CloseCurveTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				RoundRect: {
					name: "圆角矩形",
					handler: T.RoundRectTool,
					options: {}
				},
				HandDrawing: {
					name: "手绘面",
					handler: T.HandDrawing,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				Sector: {
					name: "扇形",
					handler: T.SectorTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				}
			}
		},
		SurfaceArrow: {
			name: "绘制面状箭头",
			subs: {
				DiagonalArrow: {
					name: "斜线箭头",
					handler: T.DiagonalArrowTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				StraightArrow: {
					name: "直线箭头",
					handler: T.StraightArrowTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				DoveTailDiagonalArrow: {
					name: "燕尾斜箭头",
					handler: T.DoveTailDiagonalArrowTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				DoveTailStraightArrow: {
					name: "燕尾直箭头",
					handler: T.DoveTailStraightArrowTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				},
				DoubleArrow: {
					name: "双箭头",
					handler: T.DoubleArrowTool,
					options: {
						style: {
							color: "red",
							weight: 5,
							opacity: .5,
							fillColor: "red",
							fillOpacity: .2,
							fill: !0
						}
					}
				}
			}
		},
		LineArrow: {
			name: "绘制线状箭头",
			subs: {
				PolylineArrow: {
					name: "折线箭头",
					handler: T.PolylineArrowTool
				},
				BezierCurveArrow: {
					name: "贝塞尔箭头",
					handler: T.BezierCurveArrowTool
				},
				CardinalCurveArrow: {
					name: "Cardinal箭头",
					handler: T.CardinalCurveArrowTool
				},
				SectorSearch: {
					name: "扇形搜寻区箭头",
					handler: T.SectorSearchTool
				},
				ParallelSearch: {
					name: "平行搜寻区箭头",
					handler: T.ParallelSearchTool
				}
			}
		}
	},
	initialize: function(t) {
		this.setOptions(t)
	},
	onAdd: function(t) {
		this.map = t,
		this.layers = new T.LayerGroup;
		var i = this.container = this.s("ul");
		i.style.marginBottom = "20px",
		i.id = "nav",
		this.uw(i);
		var e = this.datas;
		for (var s in e) {
			var n = e[s],
			o = n.subs,
			h = this.s("li", "", i),
			r = this.s("a", "selected", h);
			r.innerHTML = n.name;
			var a = this.s("ul", "", h);
			a.style.right = this.options.position.indexOf("right") > -1 ? "110px": "-110px",
			a.style.top = this.options.position.indexOf("top") > -1 ? "0px": "-45px";
			for (var l in o) {
				var u = o[l],
				c = this.s("li", "", a),
				f = this.s("a", "selected", c);
				f.innerHTML = u.name;
				var p = this.Ks(f, u, this.layers);
				f._item = u,
				T.oq.on(f, "click", p, this)
			}
		}
		var d = this.s("li", "", i),
		y = this.s("a", "selected", d);
		y.innerHTML = "清空图层",
		T.oq.on(y, "click", this.Td, this);
		var g = this.s("li", "", i),
		m = this.s("a", "selected", g);
		return m.innerHTML = "关闭当前工具",
		T.oq.on(m, "click", this.td, this),
		i
	},
	onRemove: function() {
		T.oq.off(this.container, "click", T.oq.uw).off(this.container, "mousedown", T.oq.uw).off(this.container, "dblclick", T.oq.uw).off(this.container, "contextmenu", T.oq.uw),
		this.jE.removeLayer(this.layers),
		this.layers = null
	},
	td: function(t) {
		this._handler.close()
	},
	Td: function(t) {
		this.layers.clearLayers()
	},
	clearLayers: function() {
		this.Td()
	},
	getLayers: function() {
		return this.layers.getLayers()
	},
	close: function() {
		this.td()
	},
	Ks: function(t, i, e) {
		var s = this,
		n = this.map;
		return function(t) {
			s._handler && s._handler.close(),
			i.options = i.options ? i.options: {},
			i.options.layers = e,
			s._handler = new i.handler(n, i.options),
			s._handler.open()
		}
	},
	s: function(t, i, e) {
		var s = document.createElement(t);
		return i && i.length > 0 && (s.className = i || ""),
		e && e.appendChild(s),
		s
	},
	uw: function(t) {
		T.oq.on(t, "click", T.oq.uw).on(t, "mousedown", T.oq.uw).on(t, "dblclick", T.oq.uw).on(t, "contextmenu", T.oq.uw)
	}
});